package com.es.hr.shop;

import javax.servlet.http.HttpServletRequest;

import com.es.business.city.CityBiz;
import com.es.business.province.ProvinceBiz;
import com.es.util.page.PageBean;
import com.opensymphony.webwork.interceptor.ServletRequestAware;
import com.opensymphony.xwork.ActionSupport;

public class ShopCTMDeleteDoAction extends ActionSupport
implements ServletRequestAware{
	 HttpServletRequest request;

	public void setServletRequest(HttpServletRequest paramHttpServletRequest) {
		// TODO Auto-generated method stub
		this.request = paramHttpServletRequest;
	}
	
	public String execute() throws Exception{
		String result = "";
		ShopBiz shopBiz = new ShopBiz();
		String[] shopIds = (String[]) request.getParameterMap().get("shop_id");
		boolean res = false;
		if(shopIds != null){
			for(int i = 0; i < shopIds.length; ++i)
				res = shopBiz.deleteShopCTMById(shopIds[i]);
			if(res == true){
				String message = "删除成功";
				this.request.setAttribute("message", message);
			}else{
				String message = "删除失败，请重新删除";
				this.request.setAttribute("message", message);
			}
		}
		
		request.setAttribute("shop_ctm_code", request.getParameter("shop_ctm_code"));
		return "success";
	}
	 

}
